// clean data
foreach v in ///
 education ///
 hourly_wage ///
 income ///
 interview ///
{
	use ../data/`v'_raw.dta, clear 
	do clean/`v'.do
	compress
	save ../processed/`v'_cln.dta, replace
}
do clean/income_pct.do

// put everything together
use ../data/background_raw.dta, clear
merge 1:m CASEID_1979 using ../processed/education_cln.dta
assert _merge==3
drop _merge
foreach name in hourly_wage income interview{
	merge 1:1 CASEID_1979 year using ../processed/`name'_cln.dta
	assert _merge==3
	drop _merge
}
merge 1:1 CASEID_1979 year using ../processed/income_pct.dta
assert _merge==1 | _merge==3
drop _merge
compress
save ../export/basic_variables.dta, replace

